<template>
	<div id="inserttask">
		<div id="screen">
			<el-select v-model="value" placeholder="请选择班级">
			    <el-option
			      v-for="item in options"
			      :key="item.value"
			      :label="item.label"
			      :value="item.value">
			    </el-option>
			</el-select>

			<el-select v-model="value2" placeholder="请选择作业次数">
			    <el-option
			      v-for="item in options2"
			      :key="item.value2"
			      :label="item.label2"
			      :value="item.value2">
			    </el-option>
			</el-select>
		</div>
		<div id="stuform">
			<el-table
		      :data="tableData"
		      style="width: 100%">
		      <el-table-column
		        prop="number"
		        label="学号"
		        width="180">
		      </el-table-column>
		      <el-table-column
		        prop="name"
		        label="姓名"
		        width="180">
		      </el-table-column>
		      <el-table-column
		        prop="class"
		        label="班级">
		      </el-table-column>
		      <el-table-column
		        prop="task1"
		        label="作业次数">
		      </el-table-column>
		      <el-table-column
		        prop="mark"
		        label="分数">
		        <template slot-scope="scope">
		        	<el-input v-model="tableData.mark" placeholder="请输入分数"></el-input>
		        </template>
		      </el-table-column>
		    </el-table>
		</div>
	</div>
</template>

<script>
	export default {
    data() {
      return {
        options: [
        {
          value: '选项1',
          label: '一班'
        }, {
          value: '选项2',
          label: '二班'
   		}
        ],
        options2: [
        {
          value2: '选项1',
          label2: '第一次'
        }, {
          value2: '选项2',
          label2: '第二次'
   		}
        ],
        value: '',
        value2:'',
        tableData:[
        	{
        		number:'01',
        		name:'同学1',
        		class: '',
        		task1: '',
        		mark:''
        	},
        	{
        		number:'02',
        		name:'同学2',
        		class: '',
        		task1: '',
        		mark:''
        	}
        ]
      }
    },
    methods:{
    	a:function(){
    		if (this.value!='') {
    			console.log(this.value);
    		}
    	}
    },
    mounted(){
            this.a();
        }
  }
</script>

<style>
	
</style>